#include <iostream>

#include "shared_ptr.hpp"

using namespace cxx_study;

class Point {
public:
  Point(int x, int y) : x(x), y(y) {
    std::cout << "构造:" << this << std::endl;
  }

  ~Point() {
    std::cout << "析构:" << this << std::endl;
  }

private:
  int x, y;
};

int main() {
  auto a = make_share_ptr<Point>(3, 4);
  shared_ptr<Point> b = a;
  shared_ptr<Point> c;
  c = a;
  b = a.get();
  std::cout << a.use_count() << " " << b.use_count() << " " << c.use_count() << std::endl;
  return 0;
}